home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Softdisk Supreme
/
Softdisk Supreme.iso
/
pc
/
DSK Files
/
0-49
/
SD023b.dsk
/
COLOR EVOLUTION.bas
< prev
next >
Wrap
BASIC Source File
|
2003-06-12
|
3KB
|
92 lines
10 TEXT : HOME : LOMEM: 4 *4096
20 VTAB 5:P$ = "*****************": GOSUB 120
30 VTAB 6:P$ = "* *": GOSUB 120
35 VTAB 7:P$ = "* COLOR *": GOSUB 120
40 VTAB 8:P$ = "* EVOLUTION *": GOSUB 120
50 VTAB 9:P$ = "* *": GOSUB 120
60 VTAB 10:P$ = "*****************": GOSUB 120
70 VTAB 15: HTAB 9: PRINT "PRESS SPACE TO START."
80 J = RND(1):K = PEEK( -16384): IF K <128 THEN 80
90 POKE -16368,0: HOME
100 Q1 = 3:Q2 = 9
105 Q3 = 12:Q4 = 12:Q5 = 12
110 GOTO 130
120 PRINT TAB( 20 - LEN(P$)/2);P$: RETURN
130 FOR I = 1 TO 3000: NEXT I
150 DEF FN NX(X) = 20 *(X <0) +X *(X <20)
160 DEF FN NY(Y) = 24 *(Y <0) +Y *(Y <24)
180 DIM P%(39,47),N%(39,47),D%(39,47)
190 DIM CL%(2000),DL%(2000)
210 GR : POKE -16302,0: COLOR= Q1: FOR I = 0 TO 47: HLIN 0,39 AT I: NEXT I:NM = 0
220 GOSUB 830
240 GOTO 363
250 NC = 0:ND = 0:NG = NG +1
255 POKE 49168,0: IF PEEK(49152) = 27 THEN TEXT : PRINT : PRINT CHR$(4)"RUNMENU"
260 X = 0
270 FOR I = 1 TO CN
280 Y = CL%(I): IF Y <0 THEN X = X +1: GOTO 360
290 COLOR= 15: PLOT 2 *X,2 *Y
300 D = DL%(I)
310 N = N%(X,Y) +D:N%(X,Y) = N
320 IF P%(X,Y) THEN ON N GOTO 345,345,350,355,345,345,345,345,345
330 IF N < >3 THEN 357
340 COLOR= Q3:EE = 0: GOSUB 430: GOTO 360
345 COLOR= Q1:EE = 1: GOSUB 430: GOTO 360
350 COLOR= Q4: GOSUB 900: GOTO 360
355 COLOR= Q5: GOSUB 900: GOTO 360
357 COLOR= Q1: PLOT 2 *X,2 *Y
360 NEXT I
363 E = INT( RND(1) *10) +1:
370 EE = 0
375 FOR I = 1 TO E
380 X = INT( RND(1) *20)
390 Y = INT( RND(1) *24)
400 COLOR= Q2: GOSUB 850
410 NEXT I
420 GOSUB 700: GOTO 250
430 IF EE = 1 THEN 440
435 PLOT 2 *X,2 *Y: PLOT 2 *X +1,2 *Y: PLOT 2 *X,2 *Y +1: PLOT 2 *X +1,2 *Y +1:P%(X,Y) = 1:D = 1: GOTO 460
440 PLOT 2 *X,2 *Y: PLOT 2 *X +1,2 *Y: PLOT 2 *X,2 *Y +1: PLOT 2 *X +1,2 *Y +1:P%(X,Y) = 0:D = -1
460 IF X = 0 OR X = 19 OR Y = 0 OR Y = 23 THEN 640
470 D%(X -1,Y -1) = D%(X -1,Y -1) +D
480 D%(X -1,Y) = D%(X -1,Y) +D
490 D%(X -1,Y +1) = D%(X -1,Y +1) +D
500 D%(X,Y -1) = D%(X,Y -1) +D
510 D%(X,Y) = D%(X,Y) +D
520 D%(X,Y +1) = D%(X,Y +1) +D
530 D%(X +1,Y -1) = D%(X +1,Y -1) +D
540 D%(X +1,Y) = D%(X +1,Y) +D
550 D%(X +1,Y +1) = D%(X +1,Y +1) +D
560 NM = NM +D
570 NC = NC +1
580 ND = ND +D
590 IF X <XL THEN XL = X
600 IF Y <YL THEN YL = Y
610 IF X >XH THEN XH = X
620 IF Y >YH THEN YH = Y
630 RETURN
640 FOR X2 = X -1 TO X +1
650 FOR Y2 = Y -1 TO Y +1
660 X3 = FN NX(X2):Y3 = FN NY(Y2)
670 D%(X3,Y3) = D%(X3,Y3) +D
680 NEXT : NEXT
690 GOTO 560
700 CN = 0
710 XL = FN NX(XL -1):XH = FN NX(XH +1): IF XL > = XH THEN I = XL:XL = XH:XH = I: IF XL = 0 OR XH = 19 THEN XL = 0:XH = 19
720 YL = FN NY(YL -1):YH = FN NY(YH +1): IF YL > = YH THEN I = YL:YL = YH:YH = I: IF YL = 0 OR YH = 23 THEN YL = 0:YH = 23
730 IF XL = 0 THEN 750
740 FOR I = 0 TO XL -1:CN = CN +1:CL%(CN) = -1: NEXT
750 FOR X = XL TO XH: FOR Y = YL TO YH
760 IF NOT D%(X,Y) THEN 800
770 D = D%(X,Y)
780 CN = CN +1:D%(X,Y) = 0
790 CL%(CN) = Y:DL%(CN) = D
800 NEXT
810 CN = CN +1:CL%(CN) = -1
820 NEXT
830 XL = 19:XH = 0:YL = 23:YH = 0
840 RETURN
850 IF P%(X,Y) = 1 THEN 880
860 GOSUB 435
880 RETURN
900 PLOT 2 *X,2 *Y: PLOT 2 *X +1,2 *Y: PLOT 2 *X,2 *Y +1: PLOT 2 *X +1,2 *Y +1: RETURN